# 拿到所有.cc文件
SOURCE_FILES := $(shell find ./ -name "*.cc")
# 所有.cc文件去掉.cc后缀
SOURCE_BASENAME_FILES := $(foreach item, $(SOURCE_FILES), $(basename $(item)))

FILE := $(firstword $(SOURCE_BASENAME_FILES))

# 编译
.PHONY:compile
compile:
	@for target in $(SOURCE_BASENAME_FILES); do \
	echo target : $$target; \
	g++ -o $$target $$target.cc; \
	done

# 清空
.PHONY:clean
clean:	
	@rm -f $(SOURCE_BASENAME_FILES)

# debug
.PHONY:debug
debug:
	@echo $(SOURCE_FILES)
	@echo $(SOURCE_BASENAME_FILES)
